import axios from 'axios';

export const incrementCounter = () => ({
  type: 'INCREMENT_COUNTER'
});

export const fetchItems = () => async (dispatch) => {
  try {
    const response = await axios.get('https://jsonplaceholder.typicode.com/users');
    dispatch({
      type: 'FETCH_ITEMS_SUCCESS',
      payload: response.data
    });
  } catch (error) {
    console.error('Error fetching items:', error);
  }
};